# -*- coding: UTF-8 -*-

class BaseModel(object):

    def __init__(self, transport_core):
        self.core = transport_core

    def getDatabase(self):
        return self._database


    def getTableName(self):
        return self._table


    def insert(self, insertData):
        ins = self.core.db.load(self.getDatabase())
        return ins.insert(self.getTableName(), insertData)


    def update(self, whereString, updateData):
        ins = self.core.db.load(self.getDatabase())
        return ins.update(self.getTableName(), whereString, updateData)


    def selectAll(self, queryString, whereString):
        ins = self.core.db.load(self.getDatabase())
        return ins.selectAll(self.getTableName(), queryString, whereString)
